package com.example.fitnessservice.module.dao;

import com.example.fitnessservice.module.pojo.UserLogin;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserLoginDao {
    //注册
    @Insert("insert into user_login values(#{userLogin.id},#{userLogin.username},#{userLogin.password},#{userLogin.email},#{userLogin.phoneNum})")
    public int register(@Param("userLogin")UserLogin userLogin);

    //登录
    @Select("select * from user_login where username = #{userLogin.username} and password = #{userLogin.password}")
    public UserLogin login(@Param("userLogin")UserLogin userLogin);
//查询是否有相同的名字
    @Select("select * from user_login where username = #{username}")
    public UserLogin username(String username);
}
